<div class='cart-product-summary'>
    <table width='100%' cellspacing='0' cellpadding='0' border='0'>
        <tbody>
            {if $user}
            <tr>
                <td colspan="2">
                    <a href="/admin/members/existing/{$user.user_id}" title="view member details">{$user.user_gname} {$user.user_surname} ({$user.user_email})</a>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    &nbsp;
                </td>
            </tr>
            {/if} {foreach from=$productsOnCart item=item}
            <tr id="cartitem{$item.cartitem_id}" {if ($item.cartitem_class_flag eq 1 && $item.availability.available lt 1) || ($item.cartitem_class_flag eq 1 && $item.cartitem_quantity gt $item.availability.available)}class="text-danger" {/if}>
                <td class='cart-product-summary-details'>
                    <a href="javascript:void(0)" class="delete-icon" onclick="deleteItem({$item.cartitem_id})"><span class="glyphicon glyphicon-remove"></span></a>
                    <strong>
                    {if $item.cartitem_custom_type}
                    	{$item.cartitem_custom_type}: 
                    {/if}
                    {$item.cartitem_product_name}
                    </strong>
                    {if $item.attributes}
                    	{assign var='hasweek' value=0}
                    	{if $item.cartitem_class_flag eq 1 && $item.cartitem_enrolment_type eq 'T' }
                    	 / Date: {getdatebyweekdaystartdate weekday=$item.class_weekday startdate=$item.term_start_date weeksafter=$item.attributes.0.cartitem_attr_attr_value_name-1 dateformat='d/m/Y'}
                    	{else}
                    		{if $item.cartitem_product_id gt 0}
                    		{foreach from=$item.attributes item=attr name=attributesarr}
                    			{if $attr.cartitem_attr_attribute_name eq 'week'}
                    				{if $hasweek eq 0}
                    					<br><small>周: </small>
                    					{assign var='hasweek' value=1}
                    				{/if}
                    				<small>{$attr.cartitem_attr_attr_value_name}
                    				{if !$smarty.foreach.attributesarr.last}|{/if}
                    				</small>
                    			{else}
                    				<br><small>- {$attr.cartitem_attr_attribute_name}: {$attr.cartitem_attr_attr_value_name}</small>
                    			{/if}
                    		{/foreach}
                    	{/if}
                    {/if}
                    {/if}
                    {foreach $classtermstudents[$item.cartitem_id] as $student}
                    <br><small>{$student}</small>
                    {/foreach}
                    <br><small>数量: {$item.cartitem_quantity}</small></td>
                <td class='cart-product-summary-price'>{$CURRENCY_SYMBOL}{$item.cartitem_subtotal|number_format:2:'.':','}</td>
            </tr>
            <tr>
                <td colspan="2">
                    &nbsp;
                </td>
            </tr>
            {/foreach}
            <tr>
                <td colspan="2">
                    <hr>
                </td>
            </tr>
            <tr>
                <td>
                    小计:
                </td>
                <td align="right">
                    <span id="subtotal">{$CURRENCY_SYMBOL}{$totals.subtotal|number_format:2:'.':','}</span>
                </td>
            </tr>
            {if $totals.discount neq '0.00'}
            <tr>
                <td>
                    学费折扣:
                </td>
                <td align="right">
                    <span id="discount">{$CURRENCY_SYMBOL}-{$totals.discount|number_format:2:'.':','}</span>
                </td>
            </tr>
            {/if}
            {assign var='total' value=$totals.total}
            {if $additional.description && $additional.amount}
            <tr>
                <td>
                    {$additional.description}:
                </td>
                <td align="right">
                    <span id="addtional">${$additional.amount|number_format:2:'.':','}</span>
                </td>
            </tr>
            {assign var='total' value=$additional.amount+$total} {/if}
            <tr class="ccsurchage">
                <td>
                    信用卡附加费:
                </td>
                <td align="right">
                    <span id="surcharge">{$CURRENCY_SYMBOL}0.00</span>
                </td>
            </tr>
            <tr class="partialpay text-success" style="display:none;">
                <td>
                    <strong>部分付款:</strong>
                </td>
                <td align="right">
                    <strong><span id="partialpayment">{$CURRENCY_SYMBOL}0.00</span></strong>
                </td>
            </tr>
            <tr>
                <td>
                    <strong>总计:</strong>
                </td>
                <td align="right">
                    <strong><span id="total">{$CURRENCY_SYMBOL}{$total|number_format:2:'.':','}</span></strong>
                </td>
            </tr>
        </tbody>
    </table>
</div>
